import { message } from 'ant-design-vue';
const checkTitleForm = async (rule: any, value: string) => {

  if (value) {
    return Promise.resolve()

  } else {
    return Promise.reject(rule.msg1)
  }
}
export default {
  component: {//展示型组件信息，每个组件的信息各不相同
    componentName: 'title', // 组件名称
    settings: {// 对应的设置项， 可能不同组件设置也不尽相同。
      value: '',
      placeholder: '请输入',
      param: 'title',
      rule: {
        required: true,
        trigger: ["blur"],
        validator: checkTitleForm,
        msg1: '标题不能为空!',
        msg2: '名称不能重复!',
        api: "fetchOssNameUnique",
        key: 'siteDomain',
        params: {}, //校验传参
      },
      label: "标题:",
      beforeText: '',
      afterText: '',
      helpMsg: '',
      api: "fetchOssNameUnique",
      width: 492,
      maxCount: 500,
      showCount: true,
      marginLeft: 32,
      marginTop: 0,
      type: 'textInput',
      associated: '',
      associatedValue: '',
    },
  }
}